<?php
	/**************************/
	/**** Fonctions SKILL *****/
	/**************************/
	function getSkillFromUser($id_user){
		$sql = 'SELECT categorie.name FROM categorie
				INNER JOIN skill ON skill.id_categorie = categorie.id_categorie
				INNER JOIN user ON user.id_user = skill.id_user
				WHERE user.id_user = '.$id_user.'';
		return fetch($sql);
	}
	function insertSkillFromUser($id_user, $skill){ 	// attention on passe un tableau de skills (checkbox)
		$sql = 'INSERT INTO skill (id_user, id_categorie) VALUES('.$id_user.', '.$skill.')';
		$result = mysql_query($sql);
	}
	function deleteSkillFromUser($id_user, $skill){
		$sql = 'DELETE FROM skill WHERE id_user ='.$id_user.' AND id_categorie ='.$skill.'';
		$result = mysql_query($sql);
	}

	function insertSkillAutreFromUser($id_user){ 	// attention on passe un tableau de skills (checkbox)
		$sql = 'INSERT INTO skill (id_user, id_categorie) VALUES('.$id_user.', 10)';
		$result = mysql_query($sql);
	}
?>